/**
 * Copyright (C) 2022-2023
 * All rights reserved, Designed By www.tonetn.com
 */
package com.xunyin.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * @Author xunyinyunshang  <3594419785@qq.com>
 * 支付相关枚举
 */
@Getter
@AllArgsConstructor
public enum PayTypeEnum {

    ALI("alipay", "支付宝支付"),
    WEIXIN("weixin", "微信支付"),
    YUE("yue", "余额支付"),
    INTEGRAL("integral", "积分兑换");


    private String value;
    private String desc;

    public static PayTypeEnum toType(String value) {
        return Stream.of(PayTypeEnum.values())
                .filter(p -> p.value.equals(value))
                .findAny()
                .orElse(null);
    }


}
